<%-- 
    Document   : consultar
    Created on : 31/05/2012, 02:03:34 PM
    Author     : Gimbet
--%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
   <tiles:insert definition ="mensaje"></tiles:insert>
    <h1> Lista de Indicadores</h1>

<logic:empty name="indicadores">
    No hay indicadores registrados
</logic:empty>
<logic:notEmpty name="indicadores">
   <div id="paginador"></div><p>Muestra hasta 4 resultados </p>
   <div id="tableContainer" class="tableContainer">
        <table id="tablaDatos" border="0" cellpadding="0" cellspacing="0" width="70%" class="scrollTable">
            <thead class="fixedHeader" id="fixedHeader">
            <th>Nombre </th>
            <th>Consultar</th>
            </thead>
            <tbody class="scrollContent">
            <logic:iterate name="indicadores" id="ind">
                <tr>
                    <td> <bean:write name="ind" property="nombre"></bean:write></td>
                    <td>
                        <html:form action="/consultarIndicador?method=search" onsubmit="return this">
                            <html:hidden name="ind" property="idIndicador"></html:hidden>
                         <div class="buttons">
                            <button type="submit" class="regular">
                                <img src="interfaz/images/buscar.png" alt=""/>
                                <bean:message key="boton.buscar" />
                            </button>
                         </div>
                        </html:form>
                    </td>
                    <td>
                         <html:form action="/eliminarIndicador" onsubmit="return confirm('Esta seguro que desea eliminarlo?')">
                            <html:hidden name="ind" property="idIndicador"></html:hidden>
                         <div class="buttons">
                            <button type="submit" class="negative">
                                <img src="interfaz/images/eliminar.png" alt=""/>
                                <bean:message key="boton.eliminar" />
                            </button>
                         </div>
                        </html:form>                       
                    </td>
               </tr>
                
            </logic:iterate>
                
                
            </tbody>
        </table>
   </div>
</logic:notEmpty>

<script type="text/javascript">

var p = new Paginador(
    document.getElementById('paginador'),
    document.getElementById('tablaDatos'),
    4
);

p.Mostrar();
</script>
</html>

